package com.jensen.controller;

import com.jensen.po.User;
import com.jensen.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Jensen on 2016/10/25.
 */
@RestController
public class WebController {

    @Autowired
    private UserService userService;

    @RequestMapping("findOne")
    public Object findOne(){
        User user=this.userService.findOne(1L);
        return user;
    }

    @RequestMapping("findAll")
    public Object findAll(){
        List<User> users=this.userService.findAll();
        return users;
    }

    @RequestMapping("getPageRs")
    public Object getPageRs(){
        return this.userService.getPage();
    }

    @RequestMapping("findGrngood")
    public Object findGrngood(){
        return this.userService.findGrngood();
    }

    @RequestMapping("/tt")
    public Object tt(){
        return this.userService.tt();
    }
}
